package pl.textureStudio.data
{
	import pl.textureStudio.data.vo.StudioTextureVO;

	/**
	 * @author michalr
	 */
	public class Storage implements IStorage
	{
		private var data:Array = [];

		public function setData( arr:Array ):void
		{
			this.data = arr;
		}

		public function get dataLength():uint
		{
			return data.length;
		}

		public function getTextureByID( id:String ):StudioTextureVO
		{
			var i : uint = 0;
			var n : uint = dataLength;
			var vo : StudioTextureVO;
			while(i<n)
			{
				vo = data[i];
				if(vo.textureID == id)return vo;
				i++;
			}
			return null;
		}

		public function getVOAtIndex( id:uint ):StudioTextureVO
		{
			return data[id];
		}

		public function pushTexture( vo:StudioTextureVO ):void
		{
		}
	}
}
